{extend name="common/layout" /}
{block name="main"}
<div class="admin-main layui-anim layui-anim-upbit" ng-app="hd" ng-controller="ctrl">
    <div class="padding30">
        <h3 class="page-box-title">{$title}</h3>
    </div>
    <div class="layui-form-box" style="width: 680px;">
    <form class="layui-form ">

        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('Old Password')}</label>
            <div class="layui-input-6">
                <input type="password" name="oldpassword" lay-verify="required" placeholder="{:lang('Please enter the old password')}" class="layui-input">
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('New Password')}</label>
            <div class="layui-input-6">
                <input type="password" name="password" lay-verify="required" placeholder="{:lang('The password must be more than 6 bits, less than 15 bits.')}" class="layui-input">
            </div>
            
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('Confirm Password')}</label>
            <div class="layui-input-6">
                <input type="password" name="repassword" lay-verify="required" placeholder="{:lang('Confirm Password')}" class="layui-input">
            </div>
            
        </div>
        </br></br>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-label-no"></label>
            <div class="layui-input-6 pleft22">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('Submit')}</button>
            </div>
            
        </div>
       
    </form>
</div>
</div>
{/block}
{block name="footer"}
<script>
    var m = angular.module('hd',[]);
    m.controller('ctrl',function($scope) {
        layui.use(['form', 'layer'], function () {
            var form = layui.form, layer = layui.layer,$= layui.jquery;
            form.on('submit(submit)', function (data) {
                // 提交到方法 默认为本身
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                $.post("", data.field, function (res) {
                    layer.close(loading);
                    if (res.code > 0) {
                        layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                            location.href = res.url;
                        });
                    } else {
                        layer.msg(res.msg, {time: 1800, icon: 2},function () {
                            if(res.code==-1){
                                location.href = res.url;
                            }
                            
                        });
                    }
                });
            })
        });
    });
</script>
{/block}